
#ifndef _Team_H_
#define _Team_H_

#include "Utils/Vector2D.h"
#include "Flag.h"
#include "Player.h"

#include <string>
#include <vector>
#include <list>

class Team {
  public:
    Team(unsigned id, std::string name);
    ~Team();

    void addPlayer(Player *player);
    std::vector<Player*> getPlayers(void);

    void setFlag(Flag *team_flag);
    Flag* getFlag(void);

    unsigned getTeamId(void);
    std::string getTeamName(void);
    void getTeamColour(unsigned char &r, unsigned char &g, unsigned char &b);

    Vector2D getRandomSpawnPoint(void);   
    std::vector<Vector2D> getSpawnPoints(void){ return spawn_points; }
 
    int getTeamScore(void);
    void changeTeamScore(int score_delta);
    
    int getNumAttackers(void);

  private:
    unsigned team_id;
    std::string team_name;
    Flag *team_flag;

    std::vector<Player*> team_players;
    std::vector<Vector2D> spawn_points;
    unsigned char team_col_r, team_col_g, team_col_b;

    int team_score;

   
    float minSpawnPointDist(Vector2D pos);
    void generateSpawnPoints(void);
};


#endif

